
import './index.scss';
import tpl from './index.html';
import touchUtil from 'libs/touch.js';
import sniff from 'libs/sniff.js';
import mainObj from '../../index.js';

let el = '#yejiModule';

let yejiObj = {
    init () {
        requestAnimationFrame(() => {
            $('#game_main').empty().append(tpl);

            requestAnimationFrame(() => {
                this.eventBind();
            });
            
        });
    },

    eventBind () {
        touchUtil.tap(document.getElementById('bugText'), () => {
            if (sniff.android || sniff.ios) {
                mainObj.setPage('bug');
            }
        });
        $('#bugText').on('click', () => {
            if (!sniff.android && !sniff.ios) {
                mainObj.setPage('bug');
            }
        })
    }
};

export default yejiObj;